<?php exit("breakcms"); ?>
{include file="public/not_index_header.php"}
<script type="text/javascript" src="system/{$BRK_CONF['admintpl']}/sys/content/list/{$COLLECTION_ENAME}.js"></script>
{if $_POST['action']=='list'}
<div class="showinfo">
    当在非编辑页面的时候 点击 "添加/编辑" 的时候会创建一篇空的文章,并且保存在回收站里,如果不正确编辑,需要手动删除.<br/>
</div>
<form action="" id="brk_form" method="post">
    <div class="showtable">
        <div class="show_top_box">
            <a {if $_POST['action']=="list"}href='#' class='current' {else} ($data="list"|bgpre:'collac-'.this) href='?{$data}' {/if}>内容列表</a><a {if $_POST['action']=="edit"}href='#' class='current' {else} ($data="edit"|bgpre:'collac-'.this) href='?{$data}' {/if}>添加/编辑</a><a {if $_POST['action']=="recycle"}href='#' class='current' {else} ($data="recycle"|bgpre:'collac-'.this) href='?{$data}' {/if}>回收站</a>
        </div>
    </div>
    <div class="showtable" id="listdiv">
        <table border="0" cellpadding="0" cellspacing="1" width="100%" class="tableborder">
            <tr  class="textcenter  tr1">
                <td width="5%"></td>
<td width="5%">ID</td>
<td width="5%">排序</td>
<td width="10%">操作</td>
<td width="20%">标题</td>
<td width="8%">所属分类</td>

            </tr>
            {foreach from="$COLL_DATA" item="COLL_row"}
            <tr  onmouseover="$reClassName=this.className;this.className='textcenter table_tr_bgin';" onmouseout="this.className=$reClassName;"  class="textcenter  {cycle values="table_tr_bg1,table_tr_bg2"}">
                 <td ><input type="checkbox" name="field[coll_selected][]" value="{$COLL_row["id"]}" /></td>
<td >{$COLL_row["id"]}{if $COLL_row["top"]}<sup><span class="id_top">顶</span></sup>{/if}</td>
<td ><input class="small_text_input" name="Component_options[id][{$COLL_row["id"]}]" value="{$COLL_row["sort"]}"/></td>
<td ><div class="data_one_row"><a href="?{$COLL_row["id"]|bgpre:"collac-edit/dataid-".this}">编辑</a>&nbsp;<a href="?{$COLL_row["id"]|bgpre:"collac-del/dataid-".this}" onclick="if(!confirm('你确定要?\n\n\n\n\n\n\n\n删除后\n不可以恢复哦')){return false}">删除</a>&nbsp;{if $_POST["action"]=="recycle"}<a href="?{$COLL_row["id"]|bgpre:"collac-tolist/dataid-".this}">列表</a>{else}<a href="?{$COLL_row["id"]|bgpre:"collac-torecycle/dataid-".this}">回收站</a>{/if}</div></td>
<td align='left'>&nbsp;&nbsp;{$COLL_row["title"]}</td>
<td align='left'><div class="data_one_row fsize10">($category=$COLL_row["category_cache"]|unserialize){foreach from=$category item="cat"}<a href="?{$cat["cid"]|bgpre:"sh-category/cid-".this}">{$cat["cname"]}</a><br/>{/foreach}</div></td>

            </tr>
            {/foreach}

        </table>
        <div class="page_div">
            ($page|COLL_PAGE:{
            'pageid'=>"a",
            'Previous'=>"<a href=\"_URL_\">上一页</a>",
            'PageNumber'=>"<a href=\"_URL_\">\{PageNumber\}</a>",
            'Next'=>"<a href=\"_URL_\">下一页</a>",
            'Start'=>"<a href=\"_URL_\">\{Start\}..</a>",
            'End'=>"<a href=\"_URL_\">..\{End\}</a>",
            'Current'=>"<a href=\"#\" class='current'>\{PageNumber\}</a>",
            'Input'=>"&nbsp;<input type='text' class='page_div_input' id='page_input_num' value='\{page_input_num\}'/>条/页&nbsp;第<input type='text' class='page_div_input' id='page_input_page' value='\{page_input_page\}'/>页&nbsp;<input class='page_div_button' type='button' id=\"page_button\" value='GO'/>"
            },
            TRUE)
            {$page}
            <script>
                document.getElementById('page_button').onclick=function(){
                    var num=($temp=parseInt(document.getElementById('page_input_num').value))?$temp:8;
                    var page=($temp=parseInt(document.getElementById('page_input_page').value))?$temp:1;
                    $str=document.location.toString().replace(/\/pagea-\d*|\/pagena-\d*/g,"");
                    document.location.replace($str+"/pagea-"+page+"/pagena-"+num)
                }
            </script>
        </div>
    </div>
    <div class="showtable">
        <div id="Component_Canvas_box">
            <div id="Component_Canvas">
            </div>
            <div class="ie6qusi"></div>
        </div>
        <div id="Component_Canvas_lib">
            <div id="Component_Canvas_lib_category">
    <div class="width100B">
        <div  class="fl">
            <select name="Component_options[category]" id="Component_options_category_select">
                <option value="0">请选择分类..</option>
                {foreach from=$FIELDS_hidden['category']['CATEGORY_ROOT']}
                <option value="{$item['cid']}">{$item['clayerstr']}{$item['cname']}</option>
                {/foreach}
            </select>
        </div>
        <div class="fl">
            <div>&nbsp;<input type="button" value="保存" onclick="id_check_box_changecategory_submit()" /></div>
        </div>
    </div>
    &nbsp;&nbsp;在此更改内容的分类,如果原数据属于多个分类,那么他们的关系将会被清空
</div>



        </div>

        <div class="show_bottom_box">
            <div class='pointer notmust' onclick="id_check_box_sort()">更新排序</div><div class='pointer' onclick="id_check_box_select_all()">全/清</div><div class='pointer' onclick="id_check_box_swop()">反选</div><div class='pointer' onclick="{if $_POST["action"]=="recycle"}id_check_box_tolist(){else}id_check_box_torecycle(){/if}">{if $_POST["action"]=="recycle"}提至列表{else}回收站{/if}</div><div class='pointer' onclick="id_check_box_del()">删除</div><div class='pointer' onclick="id_check_box_top()">置顶/撤销</div><div class='pointer' onclick="id_check_box_changecategory()">更改分类</div>
        </div>
    </div>
    <div class="showbutton_right">
        <br/>
    </div>
</form>
<iframe id='listposttarget' name='listposttarget' width='0' height='0' marginwidth='0' frameborder='0' src='about:blank'></iframe>

{include file="public/not_index_footer.php"}


{elseif $_POST['action']=='edit'}

<div class="showinfo">
    {$COLLECTION_DESC}
</div>
<form action="" id="brk_form" method="post" target="listposttarget" enctype="application/x-www-form-urlencoded" onsubmit="list_submit(this)">
    <div class="showtable">
        <div class="show_top_box">
            <a {if $_POST['action']=="list"}href='#' class='current' {else} ($data="list"|bgpre:'collac-'.this) href='?{$data}' {/if}>内容列表</a><a {if $_POST['action']=="edit"}href='#' class='current' {else} ($data="edit"|bgpre:'collac-'.this) href='?{$data}' {/if}>添加/编辑</a><a {if $_POST['action']=="recycle"}href='#' class='current' {else} ($data="recycle"|bgpre:'collac-'.this) href='?{$data}' {/if}>回收站</a>
        </div>
    </div>

    <div class="showtable2_head">
        <div class="title2">添加资料</div>
        <div>&nbsp;&nbsp;&nbsp;&nbsp;<input value="保存" type="submit" class="button"/>&nbsp;<input value="重置"   type="reset" class="button"/></div>
    </div>

    <div class="showContent">

        <div class="contentform">
            {foreach from=$FIELDS}
            {if $key==0}
            <div class="content_group_hidden">
                {foreach from=$item item=onefield}
                {$onefield}
                {/foreach}
            </div>
            {else}
            <div class="content_group_big_row">
                {foreach from=$item item=onefield}
                {$onefield}
                {/foreach}
            </div>
            {/if}
            {/foreach}
        </div>
    </div>
    <div class="showbutton_right">
        <input value="保存" type="submit" class="button"/>&nbsp;&nbsp;&nbsp;&nbsp;<input value="重置"   type="reset" class="button"/><input value="editpost" name="postaction" id='brk_foem_action' type="hidden" />
    </div>
</form>
<iframe id='listposttarget' name='listposttarget' width='0' height='0' marginwidth='0' frameborder='0' src='about:blank'></iframe>

{include file="public/not_index_footer.php"}




{elseif $_POST['action']=='recycle'}

<div class="showinfo">
    回收站的内容可以被恢复<br/> 如果点击 "添加/编辑" 后 而没有正确编辑的文章也会出现这这里.
</div>
<form action="" id="brk_form" method="post">
    <div class="showtable">
        <div class="show_top_box">
            <a {if $_POST['action']=="list"}href='#' class='current' {else} ($data="list"|bgpre:'collac-'.this) href='?{$data}' {/if}>内容列表</a><a {if $_POST['action']=="edit"}href='#' class='current' {else} ($data="edit"|bgpre:'collac-'.this) href='?{$data}' {/if}>添加/编辑</a><a {if $_POST['action']=="recycle"}href='#' class='current' {else} ($data="recycle"|bgpre:'collac-'.this) href='?{$data}' {/if}>回收站</a>
        </div>
    </div>
    <div class="showtable" id="listdiv">
        <table border="0" cellpadding="0" cellspacing="1" width="100%" class="tableborder">
            <tr  class="textcenter  tr1">
                <td width="5%"></td>
<td width="5%">ID</td>
<td width="5%">排序</td>
<td width="10%">操作</td>
<td width="20%">标题</td>
<td width="8%">所属分类</td>

            </tr>
            {foreach from="$COLL_DATA" item="COLL_row"}
            <tr  onmouseover="$reClassName=this.className;this.className='textcenter table_tr_bgin';data_row_auto_height_show(this)" onmouseout="this.className=$reClassName;"  class="textcenter  {cycle values="table_tr_bg1,table_tr_bg2"}">
                 <td ><input type="checkbox" name="field[coll_selected][]" value="{$COLL_row["id"]}" /></td>
<td >{$COLL_row["id"]}{if $COLL_row["top"]}<sup><span class="id_top">顶</span></sup>{/if}</td>
<td ><input class="small_text_input" name="Component_options[id][{$COLL_row["id"]}]" value="{$COLL_row["sort"]}"/></td>
<td ><div class="data_one_row"><a href="?{$COLL_row["id"]|bgpre:"collac-edit/dataid-".this}">编辑</a>&nbsp;<a href="?{$COLL_row["id"]|bgpre:"collac-del/dataid-".this}" onclick="if(!confirm('你确定要?\n\n\n\n\n\n\n\n删除后\n不可以恢复哦')){return false}">删除</a>&nbsp;{if $_POST["action"]=="recycle"}<a href="?{$COLL_row["id"]|bgpre:"collac-tolist/dataid-".this}">列表</a>{else}<a href="?{$COLL_row["id"]|bgpre:"collac-torecycle/dataid-".this}">回收站</a>{/if}</div></td>
<td align='left'>&nbsp;&nbsp;{$COLL_row["title"]}</td>
<td align='left'><div class="data_one_row fsize10">($category=$COLL_row["category_cache"]|unserialize){foreach from=$category item="cat"}<a href="?{$cat["cid"]|bgpre:"sh-category/cid-".this}">{$cat["cname"]}</a><br/>{/foreach}</div></td>

        </tr>
        {/foreach}

    </table>
    <div class="page_div">
        ($page|COLL_PAGE:{
        'pageid'=>"a",
        'Previous'=>"<a href=\"_URL_\">上一页</a>",
        'PageNumber'=>"<a href=\"_URL_\">\{PageNumber\}</a>",
        'Next'=>"<a href=\"_URL_\">下一页</a>",
        'Start'=>"<a href=\"_URL_\">\{Start\}..</a>",
        'End'=>"<a href=\"_URL_\">..\{End\}</a>",
        'Current'=>"<a href=\"#\" class='current'>\{PageNumber\}</a>",
        'Input'=>"&nbsp;<input type='text' class='page_div_input' id='page_input_num' value='\{page_input_num\}'/>条/页&nbsp;第<input type='text' class='page_div_input' id='page_input_page' value='\{page_input_page\}'/>页&nbsp;<input class='page_div_button' type='button' id=\"page_button\" value='GO'/>"
        },
        TRUE)
        {$page}
        <script>
            document.getElementById('page_button').onclick=function(){
                var num=($temp=parseInt(document.getElementById('page_input_num').value))?$temp:8;
                var page=($temp=parseInt(document.getElementById('page_input_page').value))?$temp:1;
                $str=document.location.toString().replace(/\/pagea-\d*|\/pagena-\d*/g,"");
                document.location.replace($str+"/pagea-"+page+"/pagena-"+num)
            }
        </script>
    </div>
</div>
<div class="showtable">
    <div class="show_bottom_box">
        <div class='pointer notmust' onclick="id_check_box_sort()">更新排序</div><div class='pointer' onclick="id_check_box_select_all()">全/清</div><div class='pointer' onclick="id_check_box_swop()">反选</div><div class='pointer' onclick="{if $_POST["action"]=="recycle"}id_check_box_tolist(){else}id_check_box_torecycle(){/if}">{if $_POST["action"]=="recycle"}提至列表{else}回收站{/if}</div><div class='pointer' onclick="id_check_box_del()">删除</div><div class='pointer' onclick="id_check_box_top()">置顶/撤销</div><div class='pointer' onclick="id_check_box_changecategory()">更改分类</div>
    </div>
</div>
<div class="showbutton_right">
    <br/>
</div>
</form>
<iframe id='listposttarget' name='listposttarget' width='0' height='0' marginwidth='0' frameborder='0' src='about:blank'></iframe>

{include file="public/not_index_footer.php"}



{elseif $_POST['action']=='update' || $_POST['action']=='error'}
{include file="public/message.php"}
{include file="public/not_index_footer.php"}
{/if}

